// Package coding_round_1 13-1221
// @Title coding_round_1
// @Description
// @Author  == 琳琳也叫王木木 ==  2021/9/7 11:39
// @Create  2021/9/7 11:39
package coding_round_1

func BalancedStringSplit(s string) int {
	res, count := 0, 0
	for i := 0; i < len(s); i++ {
		if s[i] == 'R' {
			count++
		} else {
			count--
		}
		if count == 0 {
			res++
		}
	}
	return res
}
